<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>供应商对账单（应付）</title>
	<include file="Public:header" />
	<style type="text/css">
		.input{width:100px;border:1px solid #ccc;padding:2px;}
		.input0{border:0px; padding:0px; margin:0px; height:14px; overflow:hidden;}
		.input2{border:1px solid #ccc; padding:0px; margin:1px 0px 1px 0px; height:20px; display:inline-block;}
	</style>
	<script type="text/javascript">
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";

		function open_supplier_window()
		{
			open_popup_supplier('objid=acc_id&objtitle=acc_title');
		}
		function selectall_todo()
		{
			$("input[name='chk_list']").attr("checked",true);
		}
		function selectall_undo()
		{
			$("input[name='chk_list']").attr("checked",false);
		}
		$(document).ready(function(){
			$('#misone_list_table').datagrid({
				//url: '///',
				//title: 'DataGrid',
				//width: 800,
				//height: 220,
				fitColumns: true,
				nowrap:true,
				rownumbers:true,
				showFooter:false,
				columns:[[
					{field:'col01',title:'日期',width:60},
					{field:'col13',title:'摘要',width:50},
					{field:'col02',title:'交易汇率',width:50},
					{field:'col03',title:'商品',width:100},
					{field:'col14',title:'规格',width:50},
                    {field:'col04',title:'单位',width:50},
					{field:'col05',title:'数量',width:50,align:'right'},
					{field:'col06',title:'单价',width:50,align:'right'},
					{field:'col07',title:'税率%',width:50,align:'right'},
					{field:'col08',title:'折扣%',width:50,align:'right'},
					{field:'col09',title:'未税金额',width:50,align:'right'},
					{field:'col10',title:'应付金额',width:50,align:'right'},
					{field:'col11',title:'付款金额',width:50,align:'right'},
					{field:'col12',title:'余额',width:50,align:'right'}
				]]
			});
		});
	</script>
</head>
<body class="">
	<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div>供应商对账单（应付）</div>
		<div>
		<form id="frm_search" method="post" action="{:U('Finance/ap_statement')}" style="margin:10px auto 0px 25px;">
		
		<div style="width:100%; height:25px;">
		
		<div class="list-t-l w60px">年度：</div>
		<div class="list-t-l w120px"><input type="text" id="f_year" name="f_year" class="input" value="{$f_year}" /></div>
		
		<div class="list-t-l w60px">月份：</div>
		<div class="list-t-l w120px"><input type="text" id="f_period" name="f_period" class="input" value="{$f_period}" /></div>
		
		<div class="list-t-l w60px">供应商：</div>
		<div class="list-t-l w200px"><input type="text" id="acc_id" name="acc_id" value="{$acc_id}" style="display:none;" />
					<span class="searchbox input2" >
					<input id="acc_title" name="acc_title" value="{$acc_title}" readonly="true" type="text" class="input0" style="width:170px; " />
					<span><span class="searchbox-button" onclick="open_supplier_window()"></span></span></span>
		</div>
		<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-search" onclick="$('#frm_search').submit();">生成</a>
		
		</div>
		
		<div style="height:3px; clear:both;"></div>
		
		
		</form>
		</div>
	</div>
	<div class="list-box space-out-5px">
	
	<table id="misone_list_table"><tbody>
	<php>$total_amount=0;</php>
	<volist name="datalist_opening" id="datalist_opening">
	<php>$total_amount+=(double)$datalist_opening['opening'];</php>
	<tr>		
		<td field="col01"></td>
		<td field="col13">期初-{$datalist_opening.acc_title}</td>
		<td field="col02">1</td>
		<td field="col03"><span  alt="{$acc_title}" title="{$acc_title}">{$acc_title}</span></td>
		<td field="col14">&nbsp;</td>
        <td field="col04">&nbsp;</td>
		<td field="col05">&nbsp;</td>
		<td field="col06">&nbsp;</td>
		<td field="col07">&nbsp;</td>
		<td field="col08">&nbsp;</td>
		<td field="col09">&nbsp;</td>
		<td field="col10">&nbsp;</td>
		<td field="col11">{$datalist_opening.opening|get_round=###,2}</td>
		<td field="col12"><php>echo get_round($total_amount,2);</php></td>
	</tr>
	</volist>
	<volist name="datalist" id="datalist">
	<php>$total_amount+=(double)$datalist['amount2']-(double)$datalist['amount3'];</php>
	<tr>		
		<td field="col01">{$datalist.mas_fadate|date='Y-m-d',###}</td>
		<td field="col13">{$datalist.mas_code|get_model_title=###,true}</td>
		<td field="col02">{$datalist.curr_rate}</td>
		<td field="col03"><span  alt="{$datalist.stk_title}" title="{$datalist.stk_title}">{$datalist.stk_title}</span></td>
		<td field="col14">{$datalist.spec}</td>
        <td field="col04">{$datalist.stk_uom}</td>
		<td field="col05">{$datalist.qty|get_round=###,6,false}</td>
		<td field="col06">{$datalist.price|get_round=###,6,false}</td>
		<td field="col07">{$datalist.tax_rate|get_round=###,2,false}</td>
		<td field="col08">{$datalist.disc_rate|get_round=###,2,false}</td>
		<td field="col09">{$datalist.amount1|get_round=###,2,false}</td>
		<td field="col10">{$datalist.amount2|get_round=###,2,false}</td>
		<td field="col11">{$datalist.amount3|get_round=###,2,false}</td>
		<td field="col12"><php>echo get_round($total_amount,2);</php></td>
	</tr>
	</volist>
	<tr>		
		<td field="col01"></td>
		<td field="col13"><b>期末应付</b></td>
		<td field="col02">1</td>
		<td field="col03"><span  alt="{$acc_title}" title="{$acc_title}"><b>{$acc_title}</span></b></td>
		<td field="col14">&nbsp;</td>
        <td field="col04">&nbsp;</td>
		<td field="col05">&nbsp;</td>
		<td field="col06">&nbsp;</td>
		<td field="col07">&nbsp;</td>
		<td field="col08">&nbsp;</td>
		<td field="col09">&nbsp;</td>
		<td field="col10">&nbsp;</td>
		<td field="col11">&nbsp;</td>
		<td field="col12"><b><php>echo get_round($total_amount,2);</php></b></td>
	</tr>
	</tbody></table>
	
	<div style="height:5px; clear:both;"></div>
	
	</div>
	

	
	<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div class="pages">&nbsp;余额都已换算成本位币，如果期末为负数则表示有预付款</div>
	</div>
	
	<include file="Public:window_popup" />
</body>
</html>
